<?php


class App_Helper_Table_Cell {

   public $data;
   private $attribs = array();
   public $cellid;
   public $isHeader = false;
   
   public function __construct($data, $attribs=array(), $cellid="", $isHeader=false) {
      $this->data = $data;
      $this->attribs = $attribs;
      $this->cellid = $cellid;
      $this->isHeader = $isHeader;
   }
   
   public function __toString() {
      $type = $this->isHeader ? 'th' : 'td';
      $str = "<$type";
      foreach($this->attribs as $key => $val)  {
         $str .= " $key=\"$val\"";
      }
      $str .= ">" . $this->data . "</$type>";
      return $str;
   }
}

